Skip to content

feat(types): add agent_session_stopped and agent_session_title_changed events - #2707

Merged
zimeg merged 4 commits into
mainfrom
clack/agent-session-events
Aug 26, 2026
Merged

feat(types): add agent_session_stopped and agent_session_title_changed events#2707
zimeg merged 4 commits into
mainfrom
clack/agent-session-events

Conversation

@zimeg

@zimeg zimeg commented Aug 21, 2026

Copy link
Copy Markdown
Member

Types the two agent session events an agent app receives, so app.event(...) handlers for them are type-safe in bolt-js (they flow through the SlackEvent union). Mirrors the existing assistant events.

Events

  • agent_session_stopped — the user clicked the native stop button; the app should cease work and transition the session out of processing.
    • type, channel, user, thread_ts, streaming_message_ts (string array), event_ts
  • agent_session_title_changed — the user renamed the session.
    • type, channel, user, team_id, thread_ts, title, previous_title, event_ts

Notes

  • Field sets were confirmed against live events (via a Bolt socket-mode app), not just the docs.
  • The two events are intentionally not symmetric: agent_session_title_changed carries team_id on the inner event; agent_session_stopped does not (it carries streaming_message_ts, the timestamps of any in-flight streaming messages at stop time).
  • Envelope-level fields (enterprise_id, team_id on the wrapper, authorizations) are handled by the existing event-wrapper types and are not part of these inner-event interfaces.
  • Opening as a draft reference — companion to the agents.sessions.* methods work (node-slack-sdk#2703); a Java SDK equivalent will mirror these shapes.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 96c728f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/types Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@zimeg zimeg added enhancement M-T: A feature request for new functionality pkg:types applies to `@slack/types` labels Aug 21, 2026
@zimeg zimeg self-assigned this Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.15%. Comparing base (f5fd35a) to head (96c728f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2707   +/-   ##
=======================================
  Coverage   89.15%   89.15%           
=======================================
  Files          65       65           
  Lines       10393    10393           
  Branches      473      473           
=======================================
  Hits         9266     9266           
  Misses       1096     1096           
  Partials       31       31           
Flag Coverage Δ
cli-hooks 89.15% <ø> (ø)
cli-test 89.15% <ø> (ø)
logger 89.15% <ø> (ø)
oauth 89.15% <ø> (ø)
socket-mode 89.15% <ø> (ø)
web-api 89.15% <ø> (ø)
webhook 89.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

zimeg and others added 2 commits August 21, 2026 17:23
…d events

Type the two agent session events an agent app receives, mirroring the
existing assistant events. Adds them to the SlackEvent union so bolt-js
routes them type-safely.

- agent_session_stopped: type, channel, user, thread_ts,
  streaming_message_ts (array), event_ts
- agent_session_title_changed: type, channel, user, team_id, thread_ts,
  title, previous_title, event_ts

Field sets captured from live events.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg force-pushed the clack/agent-session-events branch from 9d521d2 to cba0f8f Compare August 22, 2026 00:23
@zimeg zimeg added this to the types@next milestone Aug 26, 2026
@zimeg
zimeg marked this pull request as ready for review August 26, 2026 23:24
@zimeg
zimeg requested a review from a team as a code owner August 26, 2026 23:24
…stency

Every other file in packages/types/src/events/ is singular (app.ts,
assistant.ts, channel.ts, user.ts, …), keyed to the event-name prefix.
agents.ts was the lone plural; agent.ts matches the agent_* event prefix
and the assistant.ts sibling it was modeled on. Pure rename + index.ts
export update — no type changes.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg

zimeg commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

🗣️ Alongside an upcoming release I'll merge this for event handling improvements and expectations.

@zimeg
zimeg merged commit 916d8e9 into main Aug 26, 2026
12 checks passed
@zimeg
zimeg deleted the clack/agent-session-events branch August 26, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality pkg:types applies to `@slack/types` semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant